package 循环;

public class demo05 {
    public static void main(String[] args) {
        double h=1000;
        int i=1;
        double sum=0;
        while (i<=5){
            sum+=h;
            h=h/2;
            sum+=h;
            i++;
        }
        System.out.println("一共经过了"+sum);
    }
}
